/**
*      author: Y_Yao
*      created: 2024-12-04 20:30:03
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
int n,l,r;
int a[N],dp[N],q[N];

void solve()
{
    cin >> n >> l >> r;
    for(int i = 0;i <= n;i++)
    {
        cin >> a[i];
    }
    for(int i = 1;i < l;i++)
    {
        dp[i] = -LLINF;
    }

    int head = 0,back = -1;
    int ans = -LLINF;
    for(int i = l;i <= n;i++)
    {
        while(head <= back && dp[i - l] > dp[q[back]])
        {
            back--;
        }
        q[++back] = i - l;

        while(head <= back && q[head] < i - r)
        {
            head++;
        }

        dp[i] = dp[q[head]] + a[i];
        if(i + r > n) ans = max(ans,dp[i]);
    }

    // for(int i = 0;i <= n;i++)
    // {
    //     cout << dp[i] << " ";
    // }
    // cout << endl;

    cout << ans << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}